testsuite/gtk/filterlistmodel.c: Avoid GCCism
authorChun-wei Fan <fanc999@yahoo.com.tw>
Tue, 9 Oct 2018 08:24:15 +0000 (16:24 +0800)
committerChun-wei Fan <fanc999@yahoo.com.tw>
Tue, 9 Oct 2018 08:26:36 +0000 (16:26 +0800)
Pointer arithmetic on gpointers (void *) is a GCCism, so avoid that by
being more explicit with things.

testsuite/gtk/filterlistmodel.c

index 1e259789dc13f66b77b27e8672eb268601586334..07fdf77b6fc9c27a83a9feed4bb5d0a9f4986236 100644 (file)
@@ -180,14 +180,14 @@ static gboolean
 is_near (gpointer item,
          gpointer data)
 {
-  return ABS (g_object_get_qdata (item, number_quark) - data) <= 2;
+  return ABS (GPOINTER_TO_INT (g_object_get_qdata (item, number_quark)) - GPOINTER_TO_INT (data)) <= 2;
 }
 
 static gboolean
 is_not_near (gpointer item,
              gpointer data)
 {
-  return ABS (g_object_get_qdata (item, number_quark) - data) > 2;
+  return ABS (GPOINTER_TO_INT (g_object_get_qdata (item, number_quark)) - GPOINTER_TO_INT (data)) > 2;
 }
 
 static void